﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="user_login.aspx.cs" Inherits="user_user_login" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>用户登录</title>
    <link href="../css/ecrm03.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="/easycrm/js/Function.js"></script>
    <script type="text/javascript" src="/easycrm/js/myCheck.js"></script>
    <style type="text/css">
        .title1{
            font-size: 11pt;
            color:green;
        }
        .title2{
            font-size: 10pt;
            color:black;
        }
        .title3{
            font-size: 10pt;
            color:#336699;
        }
        .title4{
            font-size: 10pt;
            color:darkgray;
        }
    </style>
    <script language="javascript">
        window.onload = emailFieldInit;

        function emailFieldInit() {
	        var email = "";
	        //if (document.cookie != "") {
		    //    email = document.cookie.split("=")[1];
	        //}
	        
	        email=getCookie("ecrmemail");

	        document.getElementById("email").value = email;
        }
        
        function getCookie(name){
              var strCookie=document.cookie;
              var arrCookie=strCookie.split("; ");
              for(var i=0;i<arrCookie.length;i++){
                    var arr=arrCookie[i].split("=");
                    if(arr[0]==name)return arr[1];
              }
              return "";
        }
        
        function addCookie(name,value,expireHours){
              var cookieString=name+"="+escape(value);
              //判断是否设置过期时间,0=永不过期
              if(expireHours>0){
                     var date=new Date();
                     date.setTime(date.getTime+expireHours*3600*1000);
                     cookieString=cookieString+"; expire="+date.toGMTString();
              }
              document.cookie=cookieString;
        }

        function deleteCookie(name){
               var date=new Date();
               date.setTime(date.getTime()-10000);
               document.cookie=name+"=v; expire="+date.toGMTString();
        }

        function setCookie() {
	        var expireDate = new Date();
	        expireDate.setMonth(expireDate.getMonth()+6);
        	
	        var email = document.getElementById("email").value;
	        document.cookie = "ecrmemail=" + email + ";expires=" + expireDate.toGMTString();
        }
        
        function saveCookie()
        {
            if(document.getElementById("remember").checked==true)
            {
                setCookie();
	            //var email = document.getElementById("email").value;
                
                //addCookie("ecrmemail",email,10);???????
            }
        }
    </script>
    <script type="text/javascript" language="javascript">
        function chk()
        {
			if(CheckEMail(form1.email)==false) return false;
            
            saveCookie();
            
			return true;
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <table width="96%" border="0" cellpadding="0" cellspacing="0" align="center">
            <tr>
                <td style="font-weight: bold; font-size: 10pt;">
                    <div id="nav"><a class="now"><span>首页</span></a>
                    <!--
                    <a href="my_ecrm.aspx">我的名片夹</a><a href="my_givelist.aspx"><span>我的赠刊名录</span></a><a href="my_plan.aspx"><span>我的周计划</span></a><a href="easybbs.aspx"><span>员工交流区</span></a><a href="employee2.aspx"><span>员工联系表</span></a>
                    -->
                    </div>
                    <div class="clear"></div><div id="status"><div id="subnav"></div><span class="pl">&nbsp;</span></div>
                    <h1>登录EasyCRM</h1>
                    <p style="margin-left: 20px;">
                        <table border="0" cellpadding="0" cellspacing="0">
                            <tr>
                                <td class="title1">你的email地址：</td>
                            </tr>
                            <tr>
                                <td class="title3"><asp:TextBox ID="email" runat="server" Width=160></asp:TextBox>&nbsp;&nbsp;&nbsp;&nbsp;<a href="/easycrm/user/user_reg.aspx">我还没有注册</a></td>
                            </tr>
                            <tr height="15">
                                <td></td>
                            </tr>
                            <tr>
                                <td class="title1">你的密码：</td>
                            </tr>
                            <tr>
                                <td class="title3"><asp:TextBox ID="password" runat="server" TextMode="Password" Width=160></asp:TextBox>&nbsp;&nbsp;&nbsp;&nbsp;<a href="/easycrm/user/user_reback_pwd.aspx">忘记密码了</a></td>
                            </tr>
                            <tr height="15">
                                <td></td>
                            </tr>
                            <tr>
                                <td class="title1">输入验证码：</td>
                            </tr>
                            <tr>
                                <td class="title3"><asp:TextBox ID="vercode" runat="server" Width=160></asp:TextBox>&nbsp;&nbsp;<asp:Image id="vcode" runat="server" ImageAlign="AbsBottom"></asp:Image></td>
                            </tr>
                            <tr height="15">
                                <td></td>
                            </tr>
                            <tr>
                                <td class="title4"><input id="remember" name="remember" type="checkbox"/><font style="color: darkgray;">在这台电脑上记住我</font></td>
                            </tr>
                            <tr height="15">
                                <td></td>
                            </tr>
                            <tr>
                                <td><asp:Button ID="btnLogin" runat="server" Text="进入" OnClick="btnLogin_Click" />
                                    <font style="font-size: 10pt; color: red;"><asp:Literal ID="msg" runat="server"></asp:Literal></font></td>
                            </tr>
                        </table>
                    </p>
                    <div style="border-bottom: darkgray 1px dashed;"></div>
                    <span class="bottomfont">&copy;EasyCRM 2008-2009 汽车中国</span>
                </td>
            </tr>
        </table>
    </div>
    </form>
</body>
</html>
